import java.io.BufferedReader;
import java.io.InputStreamReader;

//right demo//031234161X
//right demo//0525949488
//wrong demo//0765305241
//wrong demo//1400032801
//978-7-111-47206-3
//9787111472063
public class JugeISBN {
    public static void main(String args[]) {

        System.out.println("请输入一个isbn号以进行判断：");
        BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
        try {
            int sum = 0;
            char cc = '0';
            String isbn_0 = bin.readLine();
            String isbn = isbn_0.replace("-", "");

            for (int i = 0; i < 9; i++) {
                int ii = (int) isbn.charAt(i) - 48;//'0'的ASCII为48
                sum += ii * (i + 1);
            }
            sum = sum % 11;

            if (sum == 10) {
                cc = 'X';
            }//
            else {
                cc = (char) (sum + 48);
            }

            if (cc == isbn.charAt(9)) {
                System.out.println("Right");
            } else {
                isbn_0 = isbn_0.substring(0, 9) + cc;
                System.out.println("正确isbn书号如下：");
                System.out.println(isbn_0);
                System.out.println(Math.round(-11.49));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}